<template>
  <div id="app">
    <!-- 切换文本的需求 -->
    {{ title }}
    <button @click="handleToggleText">点我切换文字</button>

    <!-- 切换输入框的值需求 -->
    <input :value="inputValue" />
    <button @click="handlePlus">点我输入框就会改变喔</button>
  </div>
</template>

<script>
export default {
  name: "App",
  // 先定义好数据
  data() {
    return {
      title: "hello world",
      inputValue: "hello world",
    };
  },
  methods: {
    handleToggleText() {
      this.title = "hello school"; // ok
    },
    handlePlus() {
      this.inputValue = "hello car";
    },
  },
};
</script>
